import request from '@/utils/request';

// 登录
export function userLogin(data) {
  return request({
    url: '/login',
    method: 'post',
    headers: {
      isToken: false,
    },
    data,
  });
}

export function userRegister(data) {
  return request({
    url: '/user/register',
    method: 'post',
    headers: {
      isToken: false,
    },
    data,
  });
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post',
  });
}

export function getUserInfo(userId) {
  return request({
    url: '/user/userInfo',
    method: 'get',
    params: { userId: userId },
  });
}

export function savaUserInfo(userinfo) {
  return request({
    url: '/user/userInfo',
    method: 'put',
    data: userinfo,
  });
}
